<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<script>

     autoCompleteClinic("clinicItemDict");
     function autoCompleteClinic(inputId){
         var url="${ctx}/oper/clinicItemDict/automatic?itemClass=D&extId=${examType.clinicItemDictLists}";
         autoComplete(inputId,url,
                 function(data){
                     var rows = [];
                     for(var i=0; i<data.length; i++){
                         rows[rows.length] = {
                             data:data[i],
                             value:data[i].id,
                             result:data[i].itemName
                         };
                     }
                     return rows;
                 },function(data, i, max){
                     return data.itemName+"|"+data.itemCode+"|"+data.price;
                 },function(event,data,formatted){
                     $("#clinicId").val(data.id);
                 })
     }

</script>
<div class="content-wrap">
        <div class="wrapper" style="bottom: 50px;">
            <ul class="nav nav-tabs">
                <li>
                    <a href="#"  onclick="loadDiv('mainCenterDiv','${ctx}/oper/examType/examItemList')">检查项目列表</a>
                </li>
                <li class="active">
                    <a href="#" onclick="loadDiv('rigthCenterDiv','${ctx}/oper/examType/examItemForm')">
                        <c:choose>
                            <c:when test="${examVsClinic.id==''|| examVsClinic.id==null}">
                                检查项目添加
                            </c:when>
                            <c:otherwise>检查项目修改</c:otherwise>
                        </c:choose>
                    </a>
                </li>
            </ul>
            <section class="panel panel-default">
                <div class="panel-body">
                    <div class="col-lg-12">
                        <form:form id="inputForm" data-parsley-validate="" modelAttribute="examVsClinic" onsubmit="return formSaveLoad('mainCenterDiv','inputForm','${ctx}/oper/examType/saveExamItem','${ctx}/oper/examType/examItemList?examTypeId=${examType.id}');" method="post" class="form-horizontal">
                            <form:hidden path="id"/>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label">检查类型：</label>
                                    <div class="col-sm-4">
                                        <form:hidden path="examType.id"></form:hidden>
                                        <form:input path="examType.name"   id="examId" data-parsley-required="true" htmlEscape="false" class="form-control"  maxlength="64" />
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label">诊疗项目：</label>
                                    <div class="col-sm-4">
                                        <form:hidden path="clinicItemDict.id" id="clinicId"></form:hidden>
                                        <form:input path="clinicItemDict.itemName" id="clinicItemDict"  data-parsley-required="true" htmlEscape="false" class="form-control"  maxlength="50" />
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label">执行科室：</label>
                                    <div class="col-sm-4">
                                        <sys:treeselect id="orgDeptId" selectedParent="true" name="performedBy" update="false" value="${examVsClinic.orgDept.id}"   labelName="${examVsClinic.orgDept.deptName}" labelValue="${examVsClinic.orgDept.deptName}"
                                                        title="科室" url="/sys/orgDept/treeData" extId="" cssClass="form-control" />
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label">备注信息：</label>
                                    <div class="col-sm-4">
                                        <form:textarea path="remarks" class="form-control"  htmlEscape="false" maxlength="500" ></form:textarea>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <div class="col-sm-offset-2 col-sm-10">
                                        <input id="btnSubmit" class="btn btn-primary" type="submit" value="保 存">&nbsp;
                                        <input id="btnCancel" class="btn" type="button" value="返 回" onclick="loadDiv('mainCenterDiv','${ctx}/oper/examType/examItemList')">
                                </div>
                            </div>
                        </form:form>
                    </div>

                </div>
            </section>
        </div>
    </div>